-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance API Reference - Documentation improvements #410
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -123,7 +123,7 @@ export class FungibleToken implements FungibleTokenCore, StorageManagement, Fung | |||
// Get the unused amount from the `ft_on_transfer` call result. | |||
let unused_amount: Balance; | |||
try { | |||
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returnes result with brackets? | |||
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returns result with brackets? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FT standard defined the encoding for the input/outputs as JSON. Since JSON does not support big integers, the FT standard uses a string type to pass the unused_amount. It would be cleaner to use JSON.parse()
instead of manually "parsing" quotes out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frol, this is out of this PR's scope, would be better in a separate PR
* @call({}) | ||
* ft_on_transfer({ sender_id, amount, msg }: { | ||
sender_id: AccountId; | ||
amount: number; | ||
msg: String; | ||
}): PromiseOrValue<number> { | ||
return this.token.ft_on_transfer({ sender_id, amount, msg }); | ||
}; | ||
* } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting is broken here, and in a few other places in the doc string examples. Please, fix them
* import { | ||
FungibleTokenCore, | ||
FungibleTokenResolver, | ||
FungibleToken, | ||
* } from "near-contract-standards/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@race-of-sloths score 5
@gtsonevv Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 5! What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
Pre-flight checklist
Motivation
Test Plan
Related issues/PRs